<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Luat开源项目脚本lib</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>script_LuaTask lib</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/aLiYun.html">aLiYun</a></li>
  <li><a href="../modules/aLiYunOta.html">aLiYunOta</a></li>
  <li><a href="../modules/agps.html">agps</a></li>
  <li><a href="../modules/agpsHxxt.html">agpsHxxt</a></li>
  <li><a href="../modules/agpsZkw.html">agpsZkw</a></li>
  <li><a href="../modules/audio.html">audio</a></li>
  <li><strong>cc</strong></li>
  <li><a href="../modules/clib.html">clib</a></li>
  <li><a href="../modules/common.html">common</a></li>
  <li><a href="../modules/console.html">console</a></li>
  <li><a href="../modules/errDump.html">errDump</a></li>
  <li><a href="../modules/ftp.html">ftp</a></li>
  <li><a href="../modules/gps.html">gps</a></li>
  <li><a href="../modules/gpsHxxt.html">gpsHxxt</a></li>
  <li><a href="../modules/gpsZkw.html">gpsZkw</a></li>
  <li><a href="../modules/http.html">http</a></li>
  <li><a href="../modules/lbsLoc.html">lbsLoc</a></li>
  <li><a href="../modules/led.html">led</a></li>
  <li><a href="../modules/link.html">link</a></li>
  <li><a href="../modules/log.html">log</a></li>
  <li><a href="../modules/misc.html">misc</a></li>
  <li><a href="../modules/mqtt.html">mqtt</a></li>
  <li><a href="../modules/net.html">net</a></li>
  <li><a href="../modules/netLed.html">netLed</a></li>
  <li><a href="../modules/ntp.html">ntp</a></li>
  <li><a href="../modules/nvm.html">nvm</a></li>
  <li><a href="../modules/patch.html">patch</a></li>
  <li><a href="../modules/pb.html">pb</a></li>
  <li><a href="../modules/pins.html">pins</a></li>
  <li><a href="../modules/pm.html">pm</a></li>
  <li><a href="../modules/powerKey.html">powerKey</a></li>
  <li><a href="../modules/record.html">record</a></li>
  <li><a href="../modules/ril.html">ril</a></li>
  <li><a href="../modules/scanCode.html">scanCode</a></li>
  <li><a href="../modules/sim.html">sim</a></li>
  <li><a href="../modules/sms.html">sms</a></li>
  <li><a href="../modules/socket.html">socket</a></li>
  <li><a href="../modules/sys.html">sys</a></li>
  <li><a href="../modules/uiWin.html">uiWin</a></li>
  <li><a href="../modules/update.html">update</a></li>
  <li><a href="../modules/utils.html">utils</a></li>
  <li><a href="../modules/websocket.html">websocket</a></li>
  <li><a href="../modules/wifiScan.html">wifiScan</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>cc</code></h1>
<p>模块功能：通话管理</p>
<p></p>
    <h3>Info:</h3>
    <ul>
        <li><strong>Copyright</strong>: openLuat</li>
        <li><strong>Release</strong>: 2017.11.2</li>
        <li><strong>License</strong>: MIT</li>
        <li><strong>Author</strong>: openLuat</li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#anyCallExist">
    anyCallExist ()
    </a></td>
	<td class="summary">是否存在通话</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#getState">
    getState (num)
    </a></td>
	<td class="summary">查询某个号码的通话状态</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#dial">
    dial (num<strong  style="color: gray;">[, delay=0]</strong>)
    </a></td>
	<td class="summary">呼出电话</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#hangUp">
    hangUp (num)
    </a></td>
	<td class="summary">挂断通话</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#accept">
    accept (num)
    </a></td>
	<td class="summary">接听电话</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#transVoice">
    transVoice (data<strong  style="color: gray;">[, loop=nil]</strong><strong  style="color: gray;">[, downLinkPlay=nil]</strong>)
    </a></td>
	<td class="summary">通话中发送声音到对端,必须是12.2K AMR格式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#dtmfDetect">
    dtmfDetect (<strong  style="color: gray;">[enable=nil]</strong><strong  style="color: gray;">[, sens=3]</strong>)
    </a></td>
	<td class="summary">设置dtmf检测是否使能以及灵敏度</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#sendDtmf">
    sendDtmf (str<strong  style="color: gray;">[, playtime=100]</strong><strong  style="color: gray;">[, intvl=100]</strong>)
    </a></td>
	<td class="summary">发送dtmf到对端</td>
	</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#CONNECTED">
    CONNECTED
    </a></td>
	<td class="summary">通话中</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#HOLD">
    HOLD
    </a></td>
	<td class="summary">通话保持中</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#DIALING">
    DIALING
    </a></td>
	<td class="summary">正在呼出</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#INCOMING">
    INCOMING
    </a></td>
	<td class="summary">正在呼入</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#DISCONNECTING">
    DISCONNECTING
    </a></td>
	<td class="summary">正在挂断通话</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#DISCONNECTED">
    DISCONNECTED
    </a></td>
	<td class="summary">通话已挂断</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "anyCallExist"></a>
    <strong  style="color: red;">
    anyCallExist ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">是否存在通话</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">bool result 存在通话返回true，否则返回false</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">result = cc.anyCallExist()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "getState"></a>
    <strong  style="color: red;">
    getState (num)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">查询某个号码的通话状态</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">num</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 查询号码</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">number state 通话状态，状态值参考本模块Fields定义</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">state = cc.getState(<span class="string">'10086'</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "dial"></a>
    <strong  style="color: red;">
    dial (num<strong  style="color: green;">[, delay=0]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">呼出电话</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">num</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 呼出号码</pre>
        </li>
        <li><span class="parameter">delay</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 0]
        <pre class="example"> 延时delay毫秒后，才发起呼叫</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">bool result，true表示允许发送at命令拨号并且发送at，false表示不允许at命令拨号</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.dial(<span class="string">'10086'</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "hangUp"></a>
    <strong  style="color: red;">
    hangUp (num)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">挂断通话</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">num</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 号码，若指定号码通话状态不对 则直接退出 不会执行挂断，若挂断时会挂断所有电话</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.hangUp(<span class="string">'10086'</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "accept"></a>
    <strong  style="color: red;">
    accept (num)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">接听电话</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">num</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 号码，若指定号码通话状态不对 则直接退出 不会接通</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.accept(<span class="string">'10086'</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "transVoice"></a>
    <strong  style="color: red;">
    transVoice (data<strong  style="color: green;">[, loop=nil]</strong><strong  style="color: green;">[, downLinkPlay=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">通话中发送声音到对端,必须是12.2K AMR格式</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">data</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 12.2K AMR格式的数据</pre>
        </li>
        <li><span class="parameter">loop</span>
            <span class="types"><span class="type">bool</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> 是否循环发送，true为循环，其余为不循环</pre>
        </li>
        <li><span class="parameter">downLinkPlay</span>
            <span class="types"><span class="type">bool</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> 声音是否在本端播放，true为播放，其余为不播放</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">bool result true为成功，false为失败</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.transVoice(<span class="string">"#!AMR\010\060*********"</span>)
cc.transVoice(<span class="string">"#!AMR\010\060*********"</span>,<span class="keyword">true</span>)
cc.transVoice(<span class="string">"#!AMR\010\060*********"</span>,<span class="keyword">true</span>,<span class="keyword">true</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "dtmfDetect"></a>
    <strong  style="color: red;">
    dtmfDetect (<strong  style="color: green;">[enable=nil]</strong><strong  style="color: green;">[, sens=3]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">设置dtmf检测是否使能以及灵敏度</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">enable</span>
            <span class="types"><span class="type">bool</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> true使能，false或者nil为不使能</pre>
        </li>
        <li><span class="parameter">sens</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 3]
        <pre class="example"> 灵敏度，最灵敏为1</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.dtmfDetect(<span class="keyword">true</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "sendDtmf"></a>
    <strong  style="color: red;">
    sendDtmf (str<strong  style="color: green;">[, playtime=100]</strong><strong  style="color: green;">[, intvl=100]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">发送dtmf到对端</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">str</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> dtmf字符串，仅支持数字、ABCD*#</pre>
        </li>
        <li><span class="parameter">playtime</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 100]
        <pre class="example"> 每个dtmf播放时间，单位毫秒</pre>
        </li>
        <li><span class="parameter">intvl</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 100]
        <pre class="example"> 两个dtmf间隔，单位毫秒</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">cc.sendDtmf(<span class="string">"123"</span>)</pre></il>
    </ul>

</dd>
</dl>
    <h2 class="section-header "><a name="Fields"></a>Fields</h2>

    <dl class="function">
    <dt>
    <a name = "CONNECTED"></a>
    <strong  style="color: red;">
    CONNECTED
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">通话中</pre>







</dd>
    <dt>
    <a name = "HOLD"></a>
    <strong  style="color: red;">
    HOLD
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">通话保持中</pre>







</dd>
    <dt>
    <a name = "DIALING"></a>
    <strong  style="color: red;">
    DIALING
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">正在呼出</pre>







</dd>
    <dt>
    <a name = "INCOMING"></a>
    <strong  style="color: red;">
    INCOMING
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">正在呼入</pre>







</dd>
    <dt>
    <a name = "DISCONNECTING"></a>
    <strong  style="color: red;">
    DISCONNECTING
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">正在挂断通话</pre>







</dd>
    <dt>
    <a name = "DISCONNECTED"></a>
    <strong  style="color: red;">
    DISCONNECTED
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">通话已挂断</pre>







</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2021-08-02 13:53:19 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

